import 'package:flutter/material.dart';

void main() {
  runApp(MaterialApp(
    home: Scaffold(
      appBar: AppBar(
        title: const Text("Function Widget Demo"),
      ),
      body: ColorWidget(),
    ),
  ));
}

class ColorWidget extends StatelessWidget {
  const ColorWidget({Key? key}) : super(key: key);

  static const int _bluePrimaryValue = 0xFF2196F3;
  static const MaterialColor blue = MaterialColor(
      _bluePrimaryValue,
    <int, Color> {
      50: Color(0xFFE3F2FD),
      100: Color(0xFFBBDEFB),
      200: Color(0xFF90CAF9),
      300: Color(0xFF64B5F6),
      400: Color(0xFF42A5F5),
      500: Color(_bluePrimaryValue),
      600: Color(0xFF1E88E5),
      700: Color(0xFF1976D2),
      800: Color(0xFF1565C0),
      900: Color(0xFF0D47A1),
    }
  );


  @override
  Widget build(BuildContext context) {
    List<Widget> children = [];
    children.add(Container(
      width: double.infinity,
      height: 60,
      color: blue.shade50,
      child: Text(blue.shade50.toString()),
    ));
    for(int i = 100; i <= 900; i+=100) {
      children.add(
          Container(
            width: double.infinity,
            height: 60,
            color: blue[i],
            child: Text(blue[i].toString()),
          )
      );
    }

    return Column(
      children: children,
    );
  }
}
